package com.catsic.zcjc.dao;

import java.util.List;

import javax.persistence.QueryHint;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.QueryHints;

import com.catsic.base.BaseDao;
import com.catsic.zcjc.entity.System;


public interface SystemDao extends BaseDao<System, String>{
	
	/**
	 * findByName:通过名称查找系统
	 * @author yangyd
	 * @param name
	 * @return System
	 */
	public System findByName(String name);
	
	@Query("select s from System s where s.station.id = ?1 and s.code=?2")
	@QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") })
	public System findByCode(String stationId,String code);
	

	@Query("select s from System s where s.station.id = ?1 order by s.code asc")
	@QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") })
	public List<System> findByStation(String stationId);
	

}
